/**
 * 推荐将此工具放在最先导入
 */
import extentContext from './context.js';

import ElTableExt from './element/el-table-ext';
import ElFormExt from './element/form-ext';

export {default as TableHelper} from './setup/TableHelper.js';
export { default as FormHelper } from './setup/FormHelper.js';
export * from './tools/constant';
export * from './tools/ListUtil';
export * from './tools/utils';
export * from './tools/storage.js';
export * from './tools/exec/TaskExec.js';
export * from './components/permission/index.js';
export {default as MySet} from './entity/MySet.js';
export { default as MessageChain } from './class/MessageChain.js';
export { default as DelayGet } from './class/DelayGet.js';
export { default as RemoteCall } from './class/RemoteCall.js';
export { default as ApiEntity } from './api/ApiEntity.js';
export { default as EventHelper } from './class/EventHelper.js';
export { default as GrabMove } from './class/GrabMove.js';
export { default as SelectFilter } from './class/SelectFilter.js';
export { default as fileDownload } from './tools/FileDownload.js';

// import './tools/ConsoleExtend.js';

import Contextmenu from './tools/contextmenu';
import Constant from './tools/constant';

import Extend from './tools/extend';
import * as Utils from './tools/utils';
import * as ListUtil from './tools/ListUtil';
import FileUtil from './tools/FileUtil';
import DateUtil from './tools/DateUtil';

import MediaPreview from './tools/MediaPreview';
import emitter from './emitter';
import { emitterInstall } from './emitter';
import { init as HistoryStateMangeInit } from './tools/HistoryStateMange';
import MaxFileUploader from './tools/MaxFileUploader';
import ThreadPool from './tools/exec/ThreadPool.js';

import TemplateApi from './api/template.api';


import TipsDirective from './directive/tips.js';
import DraggableDirective from './directive/draggable.js';
import ScopeDirective from './directive/scope';
import Permission from './components/permission/index.js';



import InfoDesc from './components/info-descriptions/index.js';


export {
  extentContext,
  Utils, // 工具
  ListUtil,
  ElTableExt, // 表格扩展
  ElFormExt, // 表单扩展
  Contextmenu, // 右键菜单
  FileUtil, // 文件工具
  emitter, // 事件工具
  TemplateApi, // Api模板
  DateUtil,
  MediaPreview, // 媒体预览
  Constant, // 常量
  // Screenshot, // 截图工具
  ThreadPool, // 线城池
  MaxFileUploader, // 大文件上传
};


export default {
  /**
   * @param {Object} vue 
   * @param {Object} params 上下文参数
   */
  install(vue, params) {
    Object.assign(extentContext(), params);
    vue.use(Extend);

    // 安装指令
    vue.use(Permission, params);
    vue.use(TipsDirective);
    vue.use(DraggableDirective);
    vue.use(ScopeDirective);
    vue.use(emitterInstall);
    vue.use(InfoDesc);

    if (params.initHistoryStateMange){
      HistoryStateMangeInit();
    }
  },
};